<?php
/**
 * Created by PhpStorm.
 * User: lx
 * Date: 2020/1/10
 * Time: 17:14
 */

namespace app\hook\behavior;

use think\Db;
use think\facade\Hook;
use think\Request;

/**
 * 商户后台管理登录钩子
 * Class AdminApiRequest
 * @package app\hook\behavior
 */
class AdminApiLoginLog
{
    public function run($param){
        $data = [
            "adminID" => $param['adminID'],
            "loginIP" => ip2long($_SERVER['REMOTE_ADDR']), // 请求者的ip       // ip2long() ip转int long2ip() 数字转ip
            "loginTime" => time()
        ];
        Db::table("mt_admin_sys_log_login")->insert($data);
    }
}